package com.m.lib;

import java.util.concurrent.LinkedBlockingQueue;

public class TwoThread extends Thread {
    LinkedBlockingQueue<String> linkedBlockingQueue;

    public TwoThread(LinkedBlockingQueue<String> linkedBlockingQueue) {
        this.linkedBlockingQueue = linkedBlockingQueue;
    }

    @Override
    public void run() {
        while (true) {
            try {
                String value = linkedBlockingQueue.take();
                for (int i=1;i<100;i++){

                }
                System.out.println("twoThread:" + value);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
